home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / misc / amag / am9305b.lha / EGS / Listing.mod < prev    next >
Text File  |  1993-04-01  |  2KB  |  55 lines

  1. MODULE EGS_Test;
  2.  
  3. FROM EGSIntui IMPORT NewWindow,WindowPtr,OpenWindow,
  4.                      CloseWindow,SysGadgetSet,
  5.                      SysGadgetTypes,EIDCMPFlagSet,
  6.                      EIDCMPFlags,EIntuiMsgPtr,
  7.                      WindowFlags,WindowFlagSet,
  8.                      ObtainColor,ReleaseColor;
  9. FROM EGSGfx   IMPORT Draw,Move,DrawModes,SetDrawMode,
  10.                      SetAPen,RectangleFill;
  11. FROM Exec     IMPORT MsgGrp;
  12.  
  13. VAR
  14.   newWin := NewWindow:(leftEdge=100,topEdge=50,
  15.             width=400,height=200,
  16.             screen=NIL,
  17.             sysGadgets={windowClose, windowDrag},
  18.             name="EGS-Fenster".data'PTR,
  19.             flags=WindowFlagSet:{GimmeZeroZero,
  20.                                        SmartRefresh},
  21.             idcmpFlags=EIDCMPFlagSet:{iWindowClose});
  22.  
  23.   DrawWindow  : WindowPtr;
  24.   Msg         : EIntuiMsgPtr;
  25.   i           : INTEGER;
  26.   oColor,
  27.   Color       : LONGINT;
  28.  
  29. BEGIN
  30.   DrawWindow:=OpenWindow(newWin);
  31.   oColor:=ObtainColor(DrawWindow.screen,$FF,$00,$00);
  32.   IF DrawWindow # NIL THEN
  33.     SetDrawMode(DrawWindow.rPort,drawAPen);
  34.     FOR i:=2 TO 388 BY 4 DO
  35.       Color:=LONGINT(i*3 MOD 256) SHL 24+
  36.           LONGINT(i*2 MOD 256) SHL 16+
  37.           LONGINT(i   MOD 256) SHL 8;
  38.       SetAPen(DrawWindow.rPort,Color);
  39.       RectangleFill(DrawWindow.rPort,i,0,4,200);
  40.     END;
  41.     SetAPen( DrawWindow.rPort, oColor);
  42.     Move( DrawWindow.rPort, 1, 1);
  43.     Draw( DrawWindow.rPort, 398, 1);
  44.     Draw( DrawWindow.rPort, 398, 198);
  45.     Draw( DrawWindow.rPort, 1, 198);
  46.     Draw( DrawWindow.rPort, 1, 1);
  47.     FORGET WaitPort(DrawWindow.port);
  48.     ReleaseColor(DrawWindow^.screen,oColor);
  49.   END;
  50. CLOSE
  51.   IF DrawWindow # NIL THEN
  52.     CloseWindow(DrawWindow);
  53.   END
  54. END EGS_Test.
  55.